import request from '@/utils/request'
const indexAnalysisApi = {
  getConditionList: '/heimdallrApi/alarmRule/condition',
  getWorkflowList: '/heimdallrApi/relation/workflow',
  getNodeConfigList: '/heimdallrApi/relation/nodeConfig',
  getIndexStatistic: '/heimdallrApi/indexAnalysis/indexStatistic',
  getTodayEqualRate: '/heimdallrApi/indexAnalysis/todayEqualRate',
  getTodayLoopRate: '/heimdallrApi/indexAnalysis/todayLoopRate',
  getWeekEqualRate: '/heimdallrApi/indexAnalysis/weekEqualRate',
}
/**
 * @name 获取指标统计分析条件列表
 */
export const getConditionList = () => {
  return request({
    url: indexAnalysisApi.getConditionList,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
/**
 * @name 获取指标统计分析工作流列表
 */
export const getWorkflowList = () => {
  return request({
    url: indexAnalysisApi.getWorkflowList,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
/**
 * @name 获取指标统计分析节点配置列表
 */
export const getNodeConfigList = () => {
  return request({
    url: indexAnalysisApi.getNodeConfigList,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
/**
 * @name 获取指标统计分析指标统计
 */
export const getIndexStatistic = (params) => {
  return request({
    url: indexAnalysisApi.getIndexStatistic,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params,
  })
}
/**
 * @name 获取指标统计分析今日相等率
 */
export const getTodayEqualRate = (params) => {
  return request({
    url: indexAnalysisApi.getTodayEqualRate,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params,
  })
}
/**
 * @name 获取指标统计分析今日循环率
 */
export const getTodayLoopRate = (params) => {
  return request({
    url: indexAnalysisApi.getTodayLoopRate,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params,
  })
}
/**
 * @name 获取指标统计分析周相等率
 */
export const getWeekEqualRate = (params) => {
  return request({
    url: indexAnalysisApi.getWeekEqualRate,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    params,
  })
}
